<?php
	
	/**
	 * 给用户添加验证
	 */
	 class AuthController extends Controller{
	 	
		public function __init(){
			//管理员ID
			$aid = session('aid');
			//管理员名称
			$adminuser = session('adminUser');
			if(!isset($aid) && !isset($adminuser)){
				go('Admin/Login/index');
			}
			$this->countOrder();
			$this->allOrder();
		}
		
		/**
		 * 统计已经付款的订单
		 */
		 public function countOrder(){
		 	$orderCount = K('GoodsOrder')->where('order_status="已付款"')->count();
			$this->assign('orderCount',$orderCount);
		 }
		 
		 /**
		  * 总订单数
		  */
		  public function allOrder(){
		 	$allOrder = K('GoodsOrder')->count();
			$this->assign('allOrder',$allOrder);
		 }
		
	 }
	